/**
 * @name 文本框的组件
 *
 */
UE.plugins['text']=function () {
   var me= this,thePlugins="text";
   me.commands[thePlugins]={
       execCommand:function (method,tplid,tpltype,fromid) {
           //alert(this.options.UEDITOR_HOME_URL + UE.leipiFormDesignUrl+'/text.html');
           var dialog = new UE.ui.Dialog({
               //iframeUrl:this.options.UEDITOR_HOME_URL + UE.leipiFormDesignUrl+'/text.html',
               iframeUrl:method+'.html?typeId='+tplid+'&tpltype='+tpltype+'&fromid='+fromid,
               name:thePlugins,
               editor:this,
               title: '文本框',
               cssRules:"width:600px;height:310px;",
               buttons:[
                   {
                       className:'edui-okbutton',
                       label:'确定',
                       onclick:function () {
                           dialog.close(true);

                       }
                   },
                   {
                       className:'edui-cancelbutton',
                       label:'取消',
                       onclick:function () {
                           dialog.close(false);
                       }
                   }]
           });
           dialog.render();
           dialog.open();
       }
   };
    var popup = new baidu.editor.ui.Popup( {
        editor:this,
        content: '',
        className: 'edui-bubble',
        _edittext: function (tplid,tpltype,fromid) {
            baidu.editor.plugins[thePlugins].editdom = popup.anchorEl;
            me.execCommand(thePlugins,tplid,tpltype,fromid);
            this.hide();
        },
        _delete:function(){
            if( window.confirm('确认删除该控件吗？') ) {
                //alert(this.anchorEl);
                baidu.editor.dom.domUtils.remove(this.anchorEl,false);
            }
            this.hide();
        }
    } );
    popup.render();
    me.addListener( 'mouseover', function( t, evt ) {
        evt = evt || window.event;
        var el = evt.target || evt.srcElement;
        var leipiPlugins = el.getAttribute('leipiplugins');
        if ( /input/ig.test( el.tagName ) && leipiPlugins==thePlugins) {
            var html = popup.formatHtml(
                '<nobr>文本框: <span onclick=$$._delete('+el.getAttribute('fromid')+') class="edui-clickable">删除</span></nobr>' );
            if ( html ) {
                popup.getDom( 'content' ).innerHTML = html;
                popup.anchorEl = el;
                popup.showAnchor( popup.anchorEl );
            } else {
                popup.hide();
            }
        }
    });
};


/**
 * 手写板
 *
 * @command textfield
 */
UE.plugins['canvas']= function () {
    var me= this,thePlugins= "canvas";
    me.commands[thePlugins]={
        execCommand:function (method,tplid,tpltype,fromid) {
            var dialog= new UE.ui.Dialog({
                //iframeUrl:this.options.UEDITOR_HOME_URL + UE.leipiFormDesignUrl+'/text.html',
                iframeUrl:method+'.html?typeId='+tplid+'&tpltype='+tpltype+'&fromid='+fromid+'&do=add',
                name:thePlugins,
                editor:this,
                title: '手写板',
                cssRules:"width:600px;height:210px;",
                buttons:[
                    {
                        className:'edui-okbutton',
                        label:'确定',
                        onclick:function () {
                            dialog.close(true);
                        }
                    },
                    {
                        className:'edui-cancelbutton',
                        label:'取消',
                        onclick:function () {
                            dialog.close(true);
                        }
                    }]
            });
            dialog.render();
            dialog.open();
        }
    };
    var popup = new baidu.editor.ui.Popup( {
        editor:this,
        content: '',
        className: 'edui-bubble',
        _edittext: function (tplid,tpltype,fromid) {
            baidu.editor.plugins[thePlugins].editdom = popup.anchorEl;
            me.execCommand(thePlugins,tplid,tpltype,fromid);
            this.hide();
        },
        _delete:function(){
            if( window.confirm('确认删除该控件吗？') ) {
                baidu.editor.dom.domUtils.remove(this.anchorEl,false);
            }
            this.hide();
        }
    } );
    popup.render();
    me.addListener( 'mouseover', function(t, evt) {
        evt = evt || window.event;
        var el = evt.target || evt.srcElement;
        var leipiPlugins = el.getAttribute('leipiplugins');
        console.log(leipiPlugins);
        if ( /input/ig.test( el.tagName ) && leipiPlugins==thePlugins) {
            var html = popup.formatHtml(
                '<nobr>手写板: <span onclick=$$._edittext('+el.getAttribute('tplid')+','+el.getAttribute('tpltype')+','+el.getAttribute('fromid')+') class="edui-clickable">编辑</span>&nbsp;&nbsp;<span onclick=$$._delete('+el.getAttribute('fromid')+') class="edui-clickable">删除</span></nobr>' );
            if ( html ) {
                popup.getDom( 'content' ).innerHTML = html;
                popup.anchorEl = el;
                popup.showAnchor( popup.anchorEl );
            } else {
                popup.hide();
            }
        }
    });
};

/**
* 单选框组
* @command radios
* @method execCommand
* @param { String } cmd 命令字符串
* @example
* ```javascript
 * editor.execCommand( 'radio');
 * ```
*/
UE.plugins['radios'] = function () {
    var me = this,thePlugins = 'radios';
    me.commands[thePlugins] = {
        execCommand:function (method,tplid,tpltype,fromid) {
            var dialog = new UE.ui.Dialog({
                iframeUrl:method+'.html?typeId='+tplid+'&tpltype='+tpltype+'&fromid='+fromid,
                name:thePlugins,
                editor:this,
                title: '单选框组',
                cssRules:"width:590px;height:370px;",
                buttons:[
                    {
                        className:'edui-okbutton',
                        label:'确定',
                        onclick:function () {
                            dialog.close(true);
                        }
                    },
                    {
                        className:'edui-cancelbutton',
                        label:'取消',
                        onclick:function () {
                            dialog.close(false);
                        }
                    }]
            });
            dialog.render();
            dialog.open();
        }
    };
    var popup = new baidu.editor.ui.Popup( {
        editor:this,
        content: '',
        className: 'edui-bubble',
        _edittext: function (tplid,tpltype,fromid) {
            baidu.editor.plugins[thePlugins].editdom = popup.anchorEl;
            me.execCommand(thePlugins,tplid,tpltype,fromid);
            this.hide();
        },
        _delete:function(){
            if( window.confirm('确认删除该控件吗？') ) {
                baidu.editor.dom.domUtils.remove(this.anchorEl,false);
            }
            this.hide();
        }
    } );
    popup.render();
    me.addListener( 'mouseover', function( t, evt ) {
        evt = evt || window.event;
        var el = evt.target || evt.srcElement;
        var leipiPlugins = el.getAttribute('leipiplugins');
        if ( /span/ig.test( el.tagName ) && leipiPlugins==thePlugins) {
            var html = popup.formatHtml(
                '<nobr>单选框组: <span onclick=$$._edittext('+el.getAttribute('tplid')+','+el.getAttribute('tpltype')+','+el.getAttribute('fromid')+') class="edui-clickable">编辑</span>&nbsp;&nbsp;<span onclick=$$._delete('+el.getAttribute('fromid')+') class="edui-clickable">删除</span></nobr>' );
            if ( html ) {
                var elInput = el.getElementsByTagName("input");
                var rEl = elInput.length>0 ? elInput[0] : el;
                popup.getDom( 'content' ).innerHTML = html;
                popup.anchorEl = el;
                popup.showAnchor( rEl);
            } else {
                popup.hide();
            }
        }
    });
};
/**
 * 复选框组
 * @command checkboxs
 * @method execCommand
 * @param { String } cmd 命令字符串
 * @example
 * ```javascript
 * editor.execCommand( 'checkboxs');
 * ```
 */
UE.plugins['checkboxs'] = function () {
    var me = this,thePlugins = 'checkboxs';
    me.commands[thePlugins] = {
        execCommand:function (method,tplid,tpltype,fromid) {
            var dialog = new UE.ui.Dialog({
                iframeUrl:method+'.html?typeId='+tplid+'&tpltype='+tpltype+'&fromid='+fromid,
                name:thePlugins,
                editor:this,
                title: '复选框组',
                cssRules:"width:600px;height:400px;",
                buttons:[
                    {
                        className:'edui-okbutton',
                        label:'确定',
                        onclick:function () {
                            dialog.close(true);
                        }
                    },
                    {
                        className:'edui-cancelbutton',
                        label:'取消',
                        onclick:function () {
                            dialog.close(false);
                        }
                    }]
            });
            dialog.render();
            dialog.open();
        }
    };
    var popup = new baidu.editor.ui.Popup( {
        editor:this,
        content: '',
        className: 'edui-bubble',
        _edittext: function (tplid,tpltype,fromid) {
            baidu.editor.plugins[thePlugins].editdom = popup.anchorEl;
            me.execCommand(thePlugins,tplid,tpltype,fromid);
            this.hide();
        },
        _delete:function(){
            if( window.confirm('确认删除该控件吗？') ) {
                baidu.editor.dom.domUtils.remove(this.anchorEl,false);
            }
            this.hide();
        }
    } );
    popup.render();
    me.addListener( 'mouseover', function( t, evt ) {
        evt = evt || window.event;
        var el = evt.target || evt.srcElement;
        var leipiPlugins = el.getAttribute('leipiplugins');
        if ( /span/ig.test( el.tagName ) && leipiPlugins==thePlugins) {
            var html = popup.formatHtml(
                '<nobr>复选框组: <span onclick=$$._edittext('+el.getAttribute('tplid')+','+el.getAttribute('tpltype')+','+el.getAttribute('fromid')+') class="edui-clickable">编辑</span>&nbsp;&nbsp;<span onclick=$$._delete('+el.getAttribute('fromid')+') class="edui-clickable">删除</span></nobr>' );
            if ( html ) {
                var elInput = el.getElementsByTagName("input");
                var rEl = elInput.length>0 ? elInput[0] : el;
                popup.getDom( 'content' ).innerHTML = html;
                popup.anchorEl = el;
                popup.showAnchor( rEl);
            } else {
                popup.hide();
            }
        }
    });
};
/**
 * 多行文本框
 * @command textarea
 * @method execCommand
 * @param { String } cmd 命令字符串
 * @example
 * ```javascript
 * editor.execCommand( 'textarea');
 * ```
 */
UE.plugins['textarea'] = function () {
    var me = this,thePlugins = 'textarea';
    me.commands[thePlugins] = {
        execCommand:function (method,tplid,tpltype,fromid) {
            var dialog = new UE.ui.Dialog({
                iframeUrl:method+'.html?typeId='+tplid+'&tpltype='+tpltype+'&fromid='+fromid,
                name:thePlugins,
                editor:this,
                title: '多行文本框',
                cssRules:"width:600px;height:330px;",
                buttons:[
                    {
                        className:'edui-okbutton',
                        label:'确定',
                        onclick:function () {
                            console.log("this oled");
                            dialog.close(true);
                        }
                    },
                    {
                        className:'edui-cancelbutton',
                        label:'取消',
                        onclick:function () {
                            dialog.close(false);
                        }
                    }]
            });
            dialog.render();
            dialog.open();
        }
    };
    var popup = new baidu.editor.ui.Popup( {
        editor:this,
        content: '',
        className: 'edui-bubble',
        _edittext: function (tplid,tpltype,fromid) {
            baidu.editor.plugins[thePlugins].editdom = popup.anchorEl;
            me.execCommand(thePlugins,tplid,tpltype,fromid);
            this.hide();
        },
        _delete:function(){
            if( window.confirm('确认删除该控件吗？') ) {
                baidu.editor.dom.domUtils.remove(this.anchorEl,false);
            }
            this.hide();
        }
    } );
    popup.render();
    me.addListener( 'mouseover', function( t, evt ) {
        evt = evt || window.event;
        var el = evt.target || evt.srcElement;
        if ( /textarea/ig.test( el.tagName ) ) {
            var html = popup.formatHtml(
                '<nobr>多行文本框: <span onclick=$$._edittext('+el.getAttribute('tplid')+','+el.getAttribute('tpltype')+','+el.getAttribute('fromid')+') class="edui-clickable">编辑</span>&nbsp;&nbsp;<span onclick=$$._delete('+el.getAttribute('fromid')+') class="edui-clickable">删除</span></nobr>' );
            if ( html ) {
                popup.getDom( 'content' ).innerHTML = html;
                popup.anchorEl = el;
                popup.showAnchor( popup.anchorEl );
            } else {
                popup.hide();
            }
        }
    });
};
/**
 * 下拉菜单
 * @command select
 * @method execCommand
 * @param { String } cmd 命令字符串
 * @example
 * ```javascript
 * editor.execCommand( 'select');
 * ```
 */
UE.plugins['select'] = function () {
    var me = this,thePlugins = 'select';
    me.commands[thePlugins] = {
        execCommand:function (method,tplid,tpltype,fromid) {
            var dialog = new UE.ui.Dialog({
                iframeUrl:method+'.html?typeId='+tplid+'&tpltype='+tpltype+'&fromid='+fromid,
                name:thePlugins,
                editor:this,
                title: '下拉菜单',
                cssRules:"width:590px;height:370px;",
                buttons:[
                    {
                        className:'edui-okbutton',
                        label:'确定',
                        onclick:function () {
                            dialog.close(true);
                        }
                    },
                    {
                        className:'edui-cancelbutton',
                        label:'取消',
                        onclick:function () {
                            dialog.close(false);
                        }
                    }]
            });
            dialog.render();
            dialog.open();
        }
    };
    var popup = new baidu.editor.ui.Popup( {
        editor:this,
        content: '',
        className: 'edui-bubble',
        _edittext: function (tplid,tpltype,fromid) {
            baidu.editor.plugins[thePlugins].editdom = popup.anchorEl;
            me.execCommand(thePlugins,tplid,tpltype,fromid);
            this.hide();
        },
        _delete:function(){

            if( window.confirm('确认删除该控件吗？') ) {
                baidu.editor.dom.domUtils.remove(this.anchorEl,false);
            }
            this.hide();
        }
    } );
    popup.render();
    me.addListener( 'mouseover', function( t, evt ) {
        evt = evt || window.event;
        var el = evt.target || evt.srcElement;
        var leipiPlugins = el.getAttribute('leipiplugins');
        if ( /select|span/ig.test( el.tagName ) && leipiPlugins==thePlugins) {
            var html = popup.formatHtml(
                '<nobr>下拉菜单: <span onclick=$$._edittext('+el.getAttribute('tplid')+','+el.getAttribute('tpltype')+','+el.getAttribute('fromid')+') class="edui-clickable">编辑</span>&nbsp;&nbsp;<span onclick=$$._delete('+el.getAttribute('fromid')+') class="edui-clickable">删除</span></nobr>' );
            if ( html ) {
                if(el.tagName=='SPAN')
                {
                    var elInput = el.getElementsByTagName("select");
                    el = elInput.length>0 ? elInput[0] : el;
                }
                popup.getDom( 'content' ).innerHTML = html;
                popup.anchorEl = el;
                popup.showAnchor( popup.anchorEl );
            } else {
                popup.hide();
            }
        }
    });

};


/**
 * 宏控件
 * @command macros
 * @method execCommand
 * @param { String } cmd 命令字符串
 * @example
 * ```javascript
 * editor.execCommand( 'macros');
 * ```
 */
UE.plugins['macros'] = function () {
    var me = this,thePlugins = 'macros';
    me.commands[thePlugins] = {
        execCommand:function (method,tplid,tpltype,fromid) {
            var dialog = new UE.ui.Dialog({
                iframeUrl:'admin.php?ac=tplhtml&fileurl=apps&tplid='+tplid+'&tpltype='+tpltype+'&fromid='+fromid+'&do=add&type='+method,
                name:thePlugins,
                editor:this,
                title: '宏控件',
                cssRules:"width:600px;height:270px;",
                buttons:[
                    {
                        className:'edui-okbutton',
                        label:'确定',
                        onclick:function () {
                            dialog.close(true);
                        }
                    },
                    {
                        className:'edui-cancelbutton',
                        label:'取消',
                        onclick:function () {
                            dialog.close(false);
                        }
                    }]
            });
            dialog.render();
            dialog.open();
        }
    };
    var popup = new baidu.editor.ui.Popup( {
        editor:this,
        content: '',
        className: 'edui-bubble',
        _edittext: function (tplid,tpltype,fromid) {
            baidu.editor.plugins[thePlugins].editdom = popup.anchorEl;
            me.execCommand(thePlugins,tplid,tpltype,fromid);
            this.hide();
        },
        _delete:function(){
            if( window.confirm('确认删除该控件吗？') ) {
                baidu.editor.dom.domUtils.remove(this.anchorEl,false);
            }
            this.hide();
        }
    } );
    popup.render();
    me.addListener( 'mouseover', function( t, evt ) {
        evt = evt || window.event;
        var el = evt.target || evt.srcElement;
        var leipiPlugins = el.getAttribute('leipiplugins');
        if ( /input/ig.test( el.tagName ) && leipiPlugins==thePlugins) {
            var html = popup.formatHtml(
                '<nobr>宏控件: <span onclick=$$._edittext('+el.getAttribute('tplid')+','+el.getAttribute('tpltype')+','+el.getAttribute('fromid')+') class="edui-clickable">编辑</span>&nbsp;&nbsp;<span onclick=$$._delete('+el.getAttribute('fromid')+') class="edui-clickable">删除</span></nobr>' );
            if ( html ) {
                popup.getDom( 'content' ).innerHTML = html;
                popup.anchorEl = el;
                popup.showAnchor( popup.anchorEl );
            } else {
                popup.hide();
            }
        }
    });
};

/**
 * 日期控件
 */
UE.plugins['date'] = function () {
    var me = this,thePlugins = 'date';
    me.commands[thePlugins] = {
        execCommand:function (method,tplid,tpltype,fromid) {
            console.log("this is ok");
            var dialog = new UE.ui.Dialog({
                iframeUrl:'admin.php?ac=tplhtml&fileurl=apps&tplid='+tplid+'&tpltype='+tpltype+'&fromid='+fromid+'&do=add&type='+method,
                name:thePlugins,
                editor:this,
                title: '日期控件',
                cssRules:"width:600px;height:270px;",
                buttons:[
                    {
                        className:'edui-okbutton',
                        label:'确定',
                        onclick:function () {
                            dialog.close(true);
                        }
                    },
                    {
                        className:'edui-cancelbutton',
                        label:'取消',
                        onclick:function () {
                            dialog.close(false);
                        }
                    }]
            });
            dialog.render();
            dialog.open();
        }
    };
    var popup = new baidu.editor.ui.Popup( {
        editor:this,
        content: '',
        className: 'edui-bubble',
        _edittext: function (tplid,tpltype,fromid) {
            baidu.editor.plugins[thePlugins].editdom = popup.anchorEl;
            me.execCommand(thePlugins,tplid,tpltype,fromid);
            this.hide();
        },
        _delete:function(){
            if( window.confirm('确认删除该控件吗？') ) {
                baidu.editor.dom.domUtils.remove(this.anchorEl,false);
            }
            this.hide();
        }
    } );
    popup.render();
    me.addListener( 'mouseover', function( t, evt ) {
        evt = evt || window.event;
        var el = evt.target || evt.srcElement;
        var leipiPlugins = el.getAttribute('leipiplugins');
        if ( /input/ig.test( el.tagName ) && leipiPlugins==thePlugins) {
            var html = popup.formatHtml(
                '<nobr>日期控件: <span onclick=$$._edittext('+el.getAttribute('tplid')+','+el.getAttribute('tpltype')+','+el.getAttribute('fromid')+') class="edui-clickable">编辑</span>&nbsp;&nbsp;<span onclick=$$._delete('+el.getAttribute('fromid')+') class="edui-clickable">删除</span></nobr>' );
            if ( html ) {
                popup.getDom( 'content' ).innerHTML = html;
                popup.anchorEl = el;
                popup.showAnchor( popup.anchorEl );
            } else {
                popup.hide();
            }
        }
    });
};
/**
 * 部门控件
 */
UE.plugins['department'] = function () {
    var me = this,thePlugins = 'department';
    me.commands[thePlugins] = {
        execCommand:function (method,tplid,tpltype,fromid) {
            var dialog = new UE.ui.Dialog({
                iframeUrl:'admin.php?ac=tplhtml&fileurl=apps&tplid='+tplid+'&tpltype='+tpltype+'&fromid='+fromid+'&do=add&type='+method,
                name:thePlugins,
                editor:this,
                title: '部门控件',
                cssRules:"width:600px;height:270px;",
                buttons:[
                    {
                        className:'edui-okbutton',
                        label:'确定',
                        onclick:function () {
                            dialog.close(true);
                        }
                    },
                    {
                        className:'edui-cancelbutton',
                        label:'取消',
                        onclick:function () {
                            dialog.close(false);
                        }
                    }]
            });
            dialog.render();
            dialog.open();
        }
    };
    var popup = new baidu.editor.ui.Popup( {
        editor:this,
        content: '',
        className: 'edui-bubble',
        _edittext: function (tplid,tpltype,fromid) {
            baidu.editor.plugins[thePlugins].editdom = popup.anchorEl;
            me.execCommand(thePlugins,tplid,tpltype,fromid);
            this.hide();
        },
        _delete:function(){
            if( window.confirm('确认删除该控件吗？') ) {
                baidu.editor.dom.domUtils.remove(this.anchorEl,false);
            }
            this.hide();
        }
    } );
    popup.render();
    me.addListener( 'mouseover', function( t, evt ) {
        evt = evt || window.event;
        var el = evt.target || evt.srcElement;
        var leipiPlugins = el.getAttribute('leipiplugins');
        if ( /input/ig.test( el.tagName ) && leipiPlugins==thePlugins) {
            var html = popup.formatHtml(
                '<nobr>部门控件: <span onclick=$$._edittext('+el.getAttribute('tplid')+','+el.getAttribute('tpltype')+','+el.getAttribute('fromid')+') class="edui-clickable">编辑</span>&nbsp;&nbsp;<span onclick=$$._delete('+el.getAttribute('fromid')+') class="edui-clickable">删除</span></nobr>' );
            if ( html ) {
                popup.getDom( 'content' ).innerHTML = html;
                popup.anchorEl = el;
                popup.showAnchor( popup.anchorEl );
            } else {
                popup.hide();
            }
        }
    });
};
/**
 * 成员控件
 */
UE.plugins['user'] = function () {
    var me = this,thePlugins = 'user';
    me.commands[thePlugins] = {
        execCommand:function (method,tplid,tpltype,fromid) {
            var dialog = new UE.ui.Dialog({
                iframeUrl:'admin.php?ac=tplhtml&fileurl=apps&tplid='+tplid+'&tpltype='+tpltype+'&fromid='+fromid+'&do=add&type='+method,
                name:thePlugins,
                editor:this,
                title: '成员控件',
                cssRules:"width:600px;height:270px;",
                buttons:[
                    {
                        className:'edui-okbutton',
                        label:'确定',
                        onclick:function () {
                            dialog.close(true);
                        }
                    },
                    {
                        className:'edui-cancelbutton',
                        label:'取消',
                        onclick:function () {
                            dialog.close(false);
                        }
                    }]
            });
            dialog.render();
            dialog.open();
        }
    };
    var popup = new baidu.editor.ui.Popup( {
        editor:this,
        content: '',
        className: 'edui-bubble',
        _edittext: function (tplid,tpltype,fromid) {
            baidu.editor.plugins[thePlugins].editdom = popup.anchorEl;
            me.execCommand(thePlugins,tplid,tpltype,fromid);
            this.hide();
        },
        _delete:function(){
            if( window.confirm('确认删除该控件吗？') ) {
                baidu.editor.dom.domUtils.remove(this.anchorEl,false);
            }
            this.hide();
        }
    } );
    popup.render();
    me.addListener( 'mouseover', function( t, evt ) {
        evt = evt || window.event;
        var el = evt.target || evt.srcElement;
        var leipiPlugins = el.getAttribute('leipiplugins');
        if ( /input/ig.test( el.tagName ) && leipiPlugins==thePlugins) {
            var html = popup.formatHtml(
                '<nobr>成员控件: <span onclick=$$._edittext('+el.getAttribute('tplid')+','+el.getAttribute('tpltype')+','+el.getAttribute('fromid')+') class="edui-clickable">编辑</span>&nbsp;&nbsp;<span onclick=$$._delete('+el.getAttribute('fromid')+') class="edui-clickable">删除</span></nobr>' );
            if ( html ) {
                popup.getDom( 'content' ).innerHTML = html;
                popup.anchorEl = el;
                popup.showAnchor( popup.anchorEl );
            } else {
                popup.hide();
            }
        }
    });
};


UE.plugins['error'] = function () {
    var me = this,thePlugins = 'error';
    me.commands[thePlugins] = {
        execCommand:function () {
            var dialog = new UE.ui.Dialog({
                iframeUrl:this.options.UEDITOR_HOME_URL + UE.leipiFormDesignUrl+'/error.html',
                name:thePlugins,
                editor:this,
                title: '异常提示',
                cssRules:"width:400px;height:130px;",
                buttons:[
                    {
                        className:'edui-okbutton',
                        label:'确定',
                        onclick:function () {
                            dialog.close(true);
                        }
                    }]
            });
            dialog.render();
            dialog.open();
        }
    };
};
UE.plugins['leipi_template'] = function () {
    var me = this,thePlugins = 'leipi_template';
    me.commands[thePlugins] = {
        execCommand:function () {
            var dialog = new UE.ui.Dialog({
                iframeUrl:this.options.UEDITOR_HOME_URL + UE.leipiFormDesignUrl+'/template.php',
                name:thePlugins,
                editor:this,
                title: '表单模板',
                cssRules:"width:640px;height:380px;",
                buttons:[
                    {
                        className:'edui-okbutton',
                        label:'确定',
                        onclick:function () {
                            dialog.close(true);
                        }
                    }]
            });
            dialog.render();
            dialog.open();
        }
    };
};